package sz.szsmk.citizencard.ui.newversion.activity.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import sz.szsmk.citizencard.R
import sz.szsmk.citizencard.model.network.bean.response.CouponListBean.CouponBean

/**
 * Copyright (c)2018
 * author: zdh
 * created on: 2018/11/15 11:26
 * description:
 */
class CouponListAdapter : BaseQuickAdapter<CouponBean,BaseViewHolder>(R.layout.item_couple) {



    override fun convert(helper: BaseViewHolder, item: CouponBean?) {
//        helper.setText(R.id.tv_title,item?.name)
//        helper.setText(R.id.tv_preferentialAmount,item?.name)


    }

    private var baseInterface: BaseInterface? = null


//    private fun loadItemData(position: Int, binding: ItemCoupleBinding) {
//        binding.couponType.text = viewData!![position].type + ""
//        binding.couponAccount.text = viewData[position].type + ""
//        binding.couponAllAcount.text = viewData[position].type + ""
//        binding.couponContent.text = viewData[position].type + ""
//        binding.couponDeadline.text = viewData[position].type + ""
//        binding.couponRange.text = viewData[position].type + ""
//        binding.couponRule.text = viewData[position].type + ""

//        if (takeCouponType) {
//            binding.couponGet.visibility = View.VISIBLE
//            binding.couponGet.setOnClickListener { v: View? -> baseInterface!!.onClick(viewData[position]) }
//        }
//        if ("电商" == binding.couponType) {
//            binding.couponType.background = mContext.resources.getDrawable(R.drawable.shape_bg_blue)
//        }
//        if ("旅游" == binding.couponType) {
//            binding.couponType.background = mContext.resources.getDrawable(R.drawable.shape_bg_red)
//        }

//    }


    interface BaseInterface {
        fun onClick(couponBean: CouponBean?) //在页面中进行点击事件处理
    }

    fun setBaseInterface(baseInterface: BaseInterface?) {
        this.baseInterface = baseInterface
    }

}